package dao.impl;

import dao.Ink;

import java.awt.*;

/**
 * 灰色墨盒
 */
public class GreyInk implements Ink {
    /**
     * 打印灰色文字
     * @param red 红
     * @param green 绿
     * @param blue 蓝
     * @return
     */
    @Override
    public String getColor(int red, int green, int blue) {
        int c = (red + green + blue) / 3;
        Color color = new Color(c,c,c);
        return "#"+Integer.toHexString(color.getRGB()).substring(2);
    }
}
